Imports Sys = System

Namespace Enhancements.Core.Logging
    ''' <summary>Base class for all possible writer types. It is not intended for the common developer to inherit from it.</summary>
    Public MustInherit Class Writer

        Friend Sub New()
        End Sub

        Private __Configuration As WriterConfiguration = Nothing
        ''' <summary>Gets the configuration used by the instance. Implementers should override this procedure if specific configuration features is intended.</summary>
        Public Overridable Property Configuration() As WriterConfiguration
            Get
                Return __Configuration
            End Get
            Protected Friend Set(ByVal _value As WriterConfiguration)
                __Configuration = _value
            End Set
        End Property

        Private __Formatter As Formatter = Nothing
        ''' <summary>Gets the formatter used by the instance. Implementers should override this procedure if specific formatter features is intended.</summary>
        Public Overridable Property Formatter() As Formatter
            Get
                Return __Formatter
            End Get
            Protected Friend Set(ByVal _value As Formatter)
                __Formatter = _value
            End Set
        End Property

        ''' <summary>This member is intended for internal usage only.</summary>
        Protected Friend __Use As Boolean = False
        ''' <summary>Gets and sets the value that defines whether the instance is enabled for logging operations. Implementers must override this procedure.</summary>
        Public MustOverride Property Use() As Boolean

        Friend MustOverride Sub ___Write(ByVal _record As ___Record)

        Private __DisposeCalled As System.Boolean = False
        Friend Property ___DisposeCalled() As System.Boolean
            Get
                Return __DisposeCalled
            End Get
            Set(ByVal _value As System.Boolean)
                ___Assert.___IsDisposedNot("Writer[instance]", ___DisposeCalled, True)
                ___Assert.___IsTrue("___DisposeCalled._value", _value, True)

                __DisposeCalled = _value
            End Set
        End Property
        Friend MustOverride Sub ___Dispose()

    End Class
End Namespace
